package com.ad_hccm.service.impl;

import com.ad_hccm.dao.LifeQualityDao;
import com.ad_hccm.domain.LifeQuality;
import com.ad_hccm.domain.PatientUser;
import com.ad_hccm.service.LifeQualityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * TODO 皮肤病生活质量表ServiceImpl
 */
@Service
public class LifeQualityServiceImpl implements LifeQualityService {
    @Autowired
    private LifeQualityDao dao;

    @Override
    public boolean save(LifeQuality domain) {
        return dao.save(domain);
    }

    @Override
    public boolean update(LifeQuality domain) {
        return dao.update(domain);
    }

    @Override
    public LifeQuality getById(String id) {
        LifeQuality domain = dao.getById(id);
        if(domain==null){
            LifeQuality lifeQuality = new LifeQuality();
            lifeQuality.setId(id);
            save(lifeQuality);
            domain = dao.getById(id);
        }
        return domain;
    }

    @Override
    public List<LifeQuality> getAll() {
        return dao.getAll();
    }
}
